package cat.sun.data;

import android.os.Handler;
import android.util.Log;

public class UpdateThread extends Thread 
{
	private Handler handler;
	private int message; 
	
	public UpdateThread(Handler handler, int message)
	{
		this.handler = handler;
		this.message = message;
	}
	
	@Override
	public void run() 
	{		
		while (!isInterrupted())
		{
			Log.v("SUN", "Sending message");
			this.handler.sendEmptyMessage(this.message);
			try 
			{
				sleep(100);
			} catch (InterruptedException e) 
			{
				this.handler.sendEmptyMessage(this.message);
				interrupt();
			}
		}
	}
}
